﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using TraitorAmongUs.Graphics;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

namespace TraitorAmongUs {
	public class Crosshair {
		public Sprite sprite;
		public Sprite bulletSprite;

		public int r, g, b;
		public int bulletCount;

		public int X {
			get {
				return sprite.X;
			}

			set {
				sprite.X = value;
			}
		}

		public int Y {
			get {
				return sprite.Y;
			}

			set {
				sprite.Y = value;
			}
		}

		public Crosshair(ContentManager content) {
			sprite = new Sprite(content, @"Images\Crosshair");
			bulletSprite = new Sprite(content, @"Images\Bullet");

			bulletCount = 3;
		}

		public Crosshair() {
			sprite = new Sprite();
			bulletSprite = new Sprite();
		}

		public void Draw(GameTime gameTime, SpriteBatch spriteBatch) {
			sprite.Draw(gameTime, spriteBatch, new Color(r, g, b));

			if(bulletCount > 0) {
				for(int i = 0; i < bulletCount; ++i) {
					bulletSprite.X = X + sprite.Width + (bulletSprite.Width * i);
					bulletSprite.Y = Y + sprite.Height - bulletSprite.Height;
					bulletSprite.Draw(gameTime, spriteBatch, new Color(r, g, b));
				}
			}
		}
	}
}
